<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ul class="page_menu">
        <c:if test ="#{LoginBean.loggedIn == true}">
             <li class="username">Anvandare <h:outputText value="#{LoginBean.currentAccount.getUsername()}"/> inloggad</li>
             <h:form>
                 <li><h:commandLink
                              value="logga ut"
                              actionListener="#{LoginBean.logout}"
                              action="#{LoginBean.navigate}"/> </li>
             </h:form>
             <li class="error">
             <h:messages layout="table"/>
             </li>
             
             
             <c:if test ="#{LoginBean.authenticationLevel.equals('customer')}">
                <li class="myReservations"><h:outputLink value="myReservations.jsf">Mina Reservationer</h:outputLink></li>
             </c:if>
        </c:if>
        <c:if test ="#{LoginBean.loggedIn == false}">
             <h:form>
                 <li class="username">Anvandarnamn: <h:inputText id="name" styleClass="usernameField" value="#{LoginBean.accountName}"/></li>
                 <li class="password">Losenord: <h:inputSecret id="passwd" styleClass="passwordField" value="#{LoginBean.password}"/></li>
                 <li class="loginLink"><h:commandLink
                        value="logga in"
                        actionListener="#{LoginBean.login}"
                        action="#{LoginBean.navigate}"/></li>
             </h:form>
             <li class="error">
                <h:messages layout="table"/>
             </li>
             <li class="register"><h:outputLink value="register.jsf">Ny kund</h:outputLink></li>
        </c:if>
        <!-- <li><h:outputLink value="login.jsf">Logga in/ut</h:outputLink></li> -->
        
    </ul>
</ui:composition>